<?php

namespace app\validate\admin;

use app\common\validate\BaseValidate;

/**
 * Class Validate
 * https://www.kancloud.cn/manual/thinkphp6_0/1037624
 * @package app\daily\validate
 */
class Room extends BaseValidate
{
    //定义验证规则
    protected $rule = [
        'room_title|包间名称' => 'require|min:5|max:15',
        'room_type|包间类型' => 'require',
        'room_cover|包间封面' => 'require',
        'room_album|包间图册' => 'require',
        'per_price|包间价格' => 'require',
        'nums|容纳人数' => 'require',
        'games|支持的游戏' => 'require',
        'start_time|开始时间' => 'require',
        'end_time|结束时间' => 'require',
    ];

    //定义验证场景要与方法名相同走自动验证
    protected $scene = [
        'create' => ['room_title', 'room_type', 'room_cover', 'store_id', 'room_album', 'per_price', 'nums', 'games', 'start_time', 'end_time'],
        'update' => ['room_title', 'room_type', 'room_cover', 'store_id', 'room_album', 'per_price', 'nums', 'games', 'start_time', 'end_time'],
    ];

}
